package targetToOffer.thrDay;

import java.util.HashMap;

/**
 * @author Godcss
 * @description
 */
public class FirstUniqChar {
    public static void main(String[] args) {
        boolean[] chars = new boolean[26];
        for (boolean aChar : chars) {
            System.out.println(aChar);
        }
    }

}
class FirstUniqCharSolution {
    public char firstUniqChar(String s) {
        HashMap<Character, Boolean> dic = new HashMap<>();
        char[] sc = s.toCharArray();
        for(char c : sc)
            dic.put(c, !dic.containsKey(c));
        for(char c : sc)
            if(dic.get(c)) return c;
        return ' ';
    }
}
